Added a 256kb custom properties truncation limit on specific GenAI attributes - #45749
Merged
Radhika Gupta (rads-1996) merged 9 commits intoMar 17, 2026
Merged
Conversation
Radhika Gupta (rads-1996)
requested review from
Jackson Weber (JacksonWeber) and
Hector Hernandez (hectorhdzg)
as code owners
March 17, 2026 17:01
Radhika Gupta (rads-1996)
requested review from
Nev (MSNev),
Jeremy Voss (jeremydvoss) and
Leighton Chen (lzchen)
as code owners
March 17, 2026 17:01
Contributor
There was a problem hiding this comment.
Pull request overview
Updates azure-monitor-opentelemetry-exporter custom property filtering so a specific allowlist of GenAI attributes is truncated at a higher limit (256 * 1024) while all other custom properties continue to truncate at the existing 64 * 1024 limit.
Changes:
- Increase truncation limit for
_GEN_AI_ATTRIBUTESvalues to256 * 1024. - Update and extend unit tests to cover mixed attributes and the new 256KB/KiB truncation behavior.
- Add a corresponding unreleased changelog entry.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| sdk/monitor/azure-monitor-opentelemetry-exporter/azure/monitor/opentelemetry/exporter/_utils.py | Applies a higher truncation cap for _GEN_AI_ATTRIBUTES in _filter_custom_properties. |
| sdk/monitor/azure-monitor-opentelemetry-exporter/tests/test_utils.py | Updates existing truncation tests and adds explicit coverage for GenAI truncation at 256 * 1024. |
| sdk/monitor/azure-monitor-opentelemetry-exporter/CHANGELOG.md | Documents the new GenAI-specific truncation limit under unreleased features. |
You can also share your feedback on Copilot code review. Take the survey.
Radhika Gupta (rads-1996)
force-pushed
the
truncate-genai-attrbs-256
branch
from
March 17, 2026 17:12
dc288b9 to
9d94fa7
Compare
Hector Hernandez (hectorhdzg)
approved these changes
Mar 17, 2026
Radhika Gupta (rads-1996)
force-pushed
the
truncate-genai-attrbs-256
branch
from
March 17, 2026 20:13
4652eb2 to
b4bab0e
Compare
Jackson Weber (JacksonWeber)
approved these changes
Mar 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The following GenAI attributes have a truncation limit of 256kb. All other custom properties will be truncated at 64kb as before -
All SDK Contribution checklist:
General Guidelines and Best Practices
Testing Guidelines